<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%String path = request.getContextPath();%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<script type="text/javascript">
	function processSendCardResult(args) {
		$.pdialog.closeCurrent();
	}
	function sendCard_submit(obj){
		if($("#cardCode").val()==''){
			alertMsg.error("请选择会员卡");
			return false;
		}
		if($("input[name='expiryDateType']:checked").val()==0) {
			if($("#year").val()==0&&$("#month").val()==0) {
				alertMsg.error("您选择的有效期为0年0月，请重选！");
				return false;
			}
		}
		$("input[name='memberCardVO.cardCode']").val($("#cardCode").val());
		$("input[name='memberCardVO.customerId']").val($("#customerId").val());
		$("input[name='memberCardVO.cardId']").val($("#cardId").val());
		return validateCallback(obj, navTabAjaxDone);
	}
</script>
  <head>
    <title>发送会员卡</title>
  </head>
  <body>
	<div class="pageContent">
		<form method="post" action="<%=path %>/memberCard/saveMemberCard.action" class="pageForm required-validate" onsubmit="return sendCard_submit(this);">
			<input name="memberCardVO.cardCode" value="" type="hidden"/>
			<input id="cardCode" name="cardCode" value="" type="hidden"/>
			<input id="cardId" name="cardId" value="" type="hidden"/>
			<input id="customerId" name="customerId" type="hidden"/>
			<input type="hidden" name="memberCardVO.customerId" value="<s:property value="memberCardVO.customerId" />">
			<input type="hidden" name="memberCardVO.cardId" value="<s:property value="memberCardVO.cardId" />">
			<div class="pageFormContent" layoutH="56">
				<p>
					<label>请选择会员卡：</label>
					<input name="cardName" value="" style="float: left;" readonly="readonly">
					<a class="btnLook" href="<%=path%>/cardEntity/listCardEntity.action?cardEntityVO.custSend=0&searchType=sendCard" lookupGroup="">选择</a>
				</p>
				<div class="divider"></div>
				<input name="memberCardVO.userId" value="${registerUserId}" type="hidden"/>
				<input name="memberCardVO.sendType" value="0" type="hidden"/>
				<p>
					<label>会员名：</label>
					<input name="memberCardVO.memberName" value="${registerUserName}" class="" type="text" size="30"/>
				</p>
				<p>
					<label>联系电话：</label>
					<input name="memberCardVO.memberPhone" value="${phone}" class="" type="text" size="30"/>
				</p>
				<p>
					<label>会员性别：</label>
					<s:select name="memberCardVO.memberSex"
								list="%{#{-1:'请选择',1:'男',0:'女'}}" listKey="key" listValue="value" cssClass="combox"></s:select>
				</p>
				<p>
					<label>卡有效期：</label>
					<input type="radio" checked="checked" name="expiryDateType" value="0" onclick="$('#p_expiryDate').css('display','block');"/>自选有效期
					<input type="radio" name="expiryDateType" value="1" onclick="$('#p_expiryDate').css('display','none');"/>使用会员卡有效期
				</p>
				<p id="p_expiryDate">
					<label>&nbsp;</label>
					<select name="year" class="combox" id="year">
						<option value="0">0年</option>
						<option value="1" selected="selected">1年</option>
						<option value="2">2年</option>
						<option value="3">3年</option>
						<option value="4">4年</option>
						<option value="5">5年</option>
					</select>
					<select name="month" class="combox" id="month">
						<option value="0" selected="selected">0月</option>
						<option value="1">1月</option>
						<option value="2">2月</option>
						<option value="3">3月</option>
						<option value="4">4月</option>
						<option value="5">5月</option>
						<option value="6">6月</option>
						<option value="7">7月</option>
						<option value="8">8月</option>
						<option value="9">9月</option>
						<option value="10">10月</option>
						<option value="11">11月</option>
					</select>
				</p>
				<p id="email" style="display:none">
					<label>会员Email：</label>
					<input id="email_text" name="memberCardVO.memberEmail" value="<s:property value="memberCardVO.memberEmail" />" class="" type="text" size="30"/>
				</p>
				<p id="qq" style="display:none">
					<label>会员QQ：</label>
					<input id="qq_text" name="memberCardVO.memberQq" value="<s:property value="memberCardVO.memberQq" />" class="" type="text" size="30"/>
				</p>
				<p id="address" style="display:none">
					<label>会员联系地址：</label>
					<input id="address_text" name="memberCardVO.memberAddress" value="<s:property value="memberCardVO.memberAddress" />" class="" type="text" size="30"/>
				</p>
				<p id="idcard" style="display:none">
					<label>会员身份证号：</label>
					<input id="idcard_text" name="memberCardVO.membeIdCard" value="<s:property value="memberCardVO.membeIdCard" />" class="" type="text" size="20"/>
				</p>
				<p id="birthday" style="display:none">
					<label>会员出生日期：</label>
					<input id="birthday_text" name="memberCardVO.memberBirth" value="<s:date name="memberCardVO.memberBirth" format="yyyy-MM-dd" />" class="date" type="text" size="10"/>
				</p>
			</div>
			<div class="formBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li>
						<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
					</li>
				</ul>
			</div>
		</form>
	</div>
  </body>
</html>